from selenium.webdriver.common.by import By

from web_objects.Calendar_web_objects.calendarCreate_page import CalendarCreatePage
from web_objects.base_page import BasePage


class CalendarPage(BasePage):
    _base_url = 'https://cj8m5s4d8c.feishu.cn/calendar/week'

    def goto_create(self):
        # 点击加号
        self.find(By.CSS_SELECTOR, '.sidebar-more-trigger').click()
        # 点击新建日历
        self.find(By.XPATH, '//div[@class="sidebar-more-popup"][1]').click()
        return CalendarCreatePage(self.driver)

    def calendar_get(self):
        pass

    def get_tips(self):
        return self.find(By.CSS_SELECTOR, '.larkc-toast').text